package smu.mm;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

@SuppressWarnings("serial")
public class manage extends Frame implements ActionListener {
	JButton     professor, student, information;
	
	public manage() {
		super("Management System");
		setLayout(new BorderLayout());

		Panel center = new Panel();
		//again test
		Panel prof = new Panel();
		ImageIcon pro = new ImageIcon("images/prof.png");
		prof.add(professor = new JButton(pro));
		professor.addActionListener(this);
		
		Panel stud = new Panel();
		ImageIcon se = new ImageIcon("images/stu.png");
		stud.add(student = new JButton(se));
		student.addActionListener(this);
		
		Panel dis = new Panel();
		ImageIcon disp = new ImageIcon("images/info.png");
		dis.add(information = new JButton(disp));
		information.addActionListener(this);
		
		center.add(prof);
		center.add(stud);
		center.add(dis);


		addWindowListener(new WindowAdapter() {	
			public void windowClosing(WindowEvent e) {
				setVisible(false);
				dispose();	
				System.exit(0);	
			}
		});
		add("Center", center);
	}

	public void actionPerformed(ActionEvent e) {	
		JButton c = (JButton) e.getSource();
		try {
			if(c == professor) {
				testpf seoyoung2 = new testpf();	
				seoyoung2.setSize(800, 500);
				seoyoung2.setVisible(true);
				this.dispose();
			}else if(c == student){
				teststu  tests = new teststu();
				tests.setSize(1400, 500);
				tests.setVisible(true);
				this.dispose();
			}else if( c == information){
				testinfo testin = new testinfo();
				testin.setSize(1000, 600);
				testin.setVisible(true);
				this.dispose();
			}
			
		} catch(Exception ex) { }

		return ;
	}

	public static void main(String[]args){
		manage seoyoung = new manage();
		seoyoung.setSize(1000, 850);
		seoyoung.setVisible(true);
		
	}
}
